﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations.Schema;
using DapperExtensions.Mapper;
namespace LS.Entitys
{
    /// <summary>
    /// 新闻
    /// </summary>
    [Table("cms_news")]
    public class CmsNewsEntity:EntityBaseUpdateDateDel
    {

        /// <summary>
        /// 分类
        /// </summary>
        public long Catagory { get; set; }
        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }
        /// <summary>
        /// 介绍
        /// </summary>
        public string Note { get; set; }
        /// <summary>
        /// 图片
        /// </summary>
        public string ImgPath { get; set; }
        /// <summary>
        /// 关键字
        /// </summary>
        public string Keywords { get; set; }
        /// <summary>
        /// 详情富文本
        /// </summary>
        public string Content { get; set; }
        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime? PubDate { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int? NewSeq { get; set; }
        /// <summary>
        /// 阅读量
        /// </summary>
        public int? ReadCount { get; set; }
        /// <summary>
        /// 是否推荐
        /// </summary>
        public int? IsIndex { get; set; }
        /// <summary>
        /// 状态 0未发布 1已发布
        /// </summary>
        public int NewStatus { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        public string CatagoryName { get; set; }


    }
    public class CmsNewsEntityMapper : ClassMapper<CmsNewsEntity>
    {
        public CmsNewsEntityMapper()
        {
            Table("cms_news");
            Map(m => m.CatagoryName).Ignore();
            AutoMap();
        }
    }
}
